تخطي الملاحة
41

Almost every multilingual site has some untranslated content. This has always been a problem when using WPML, as untranslated content doesn’t show up in other languages. Let’s see if we can do something about it.

WPML keeps strict separation between languages. Every post or page is unique in the database and includes content in its own language only.

When switching languages, WPML displays only content in that language.

This means that the site’s navigation will show only pages, categories and posts in the current language. If you switch to content in another language, the language switches and now you see the navigation in that language. Clicking on other links will lead you to content in the other language.

Different Languages for Content and Navigation is Problematic

Folks have asked us to allow showing content in one language but keep the navigation in another. This is super-problematic and we don’t see a way to do it.

It means hooking to a gazillion places and making WordPress think it’s on a different page than it actually is. It will add a huge amount of code and increase the number of database queries significantly.

Instead – Auto-Duplicate Untranslated Content

While we can’t show content in one language and navigation in another, we can certainly duplicate content to all languages. This is what I’m thinking about:

  • The Translation Dashboard screen will have a new button for duplicating content. Instead of just ‘send to translation‘, it will also have ‘duplicate content‘. This means that you can use all the filtering power of the Translation Dashboard to choose what you want to duplicate.
  • When you duplicate content, WPML will automatically adjust links in the duplicated posts and pages. This means that inline links will retain the current language.
  • WPML will show duplicate and translated content differently. This way, if you later decide to translate content that you duplicated, you can still locate it and send to translation.

We will also a way to tell WPML to auto-duplicate new or updated content. This will save you the hassle of going through the Translation Dashboard every time you create or change something.

Pros

There’s no performance penalty – all this operation is done in the WordPress Admin once, and not every time visitors come to your site. For me, this is the major advantage.

It will work – this change doesn’t require any additional filtering or hooking and is not sensitive to future changes in WordPress. It’s also theme-friendly.

It’s selective – you decide which content to duplicate and when.

Cons

It’s not a fully automated solution in the sense that you tell WPML to do it once and it just happens.

Duplicate content will sit in your database and increase its size (but it’s not as bad as it sounds). The WordPress revisions system takes far more memory than this and is not a big deal either.

What do you think?

This is a fairly big job and we’ve been hesitant about it. Now that we have more developers, we can tackle greater challenges.

Before we jump on this, I’d like to see what you’re thinking and make sure that we’re not forgetting anything. Leave your comments and lets see!